home *** CD-ROM | disk | FTP | other *** search
/ Chip 1999 January / Chip_1999-01_cd.bin / kaleid / VSSKB / VSSKB95.EXE / Kb256.dxr / 00022_UI Pushbutton.ls < prev    next >
Encoding:
Text File  |  1998-11-23  |  1.8 KB  |  59 lines

  1. property UpCM, DownCM, UpNum, DownNum, button_active
  2.  
  3. on mouseDown me
  4.   set the member of sprite the spriteNum of me to member the DownCM of me
  5.   set the button_active of me to 1
  6.   puppetSound(3, "Lnup3fst")
  7. end
  8.  
  9. on mouseUp me
  10.   set the member of sprite the spriteNum of me to member the UpCM of me
  11.   set the button_active of me to 0
  12.   go(#previous)
  13. end
  14.  
  15. on mouseEnter me
  16.   if the button_active of me then
  17.     set the member of sprite the spriteNum of me to member the DownCM of me
  18.   end if
  19.   cursor(260)
  20.   cursor(260)
  21. end
  22.  
  23. on mouseLeave me
  24.   if the button_active of me then
  25.     set the member of sprite the spriteNum of me to member the UpCM of me
  26.   end if
  27.   cursor(0)
  28. end
  29.  
  30. on mouseUpOutSide me
  31.   set the button_active of me to 0
  32. end
  33.  
  34. on beginSprite me
  35.   set the UpCM of me to the member of sprite the spriteNum of me
  36.   set the UpNum of me to the number of member UpCM
  37.   set the DownNum of me to the number of member DownCM
  38.   set the button_active of me to 0
  39. end
  40.  
  41. on endSprite me
  42. end
  43.  
  44. on getPropertyDescriptionList
  45.   if the currentSpriteNum = 0 then
  46.     set memdefault to 0
  47.   else
  48.     set memref to the member of sprite the currentSpriteNum
  49.     set castLibNum to the castLibNum of memref
  50.     set memdefault to member (the memberNum of member memref + 1) of castLib castLibNum
  51.   end if
  52.   set p_list to [#DownCM: [#comment: "Hilite Image:", #format: #graphic, #default: memdefault]]
  53.   return p_list
  54. end
  55.  
  56. on getBehaviorDescription
  57.   return "Makes a sprite work as a pushbutton with automatic highlighting and mouse tracking. The sprite's initial castmember represents the button's normal state." & RETURN & "PARAMETERS:" & RETURN & "ΓÇó Hilite Image - Choose the cast member to display when the button is pressed. The default value is the cast member immedietly following the sprite's current cast member."
  58. end
  59.